package de.tum.in.eist.poll.shared;

import java.io.Serializable;

/**
 * Representation of an abstract user.
 */
@SuppressWarnings("serial")
public abstract class User implements Serializable {

	/**
	 * The user's unique name.
	 */
	private String name;

	/**
	 * The user's password.
	 */
	private String password;

	/**
	 * Default zero-argument constructor.
	 */
	public User() {
	}

	/**
	 * @param name
	 *            {@link #name}
	 * @param password
	 *            {@link #password}
	 */
	public User(final String name, final String password) {
		this.name = name;
		this.password = password;
	}

	/**
	 * @return the {@link #name}.
	 */
	public final String getName() {
		return name;
	}

	/**
	 * @return the {@link #password}.
	 */
	public final String getPassword() {
		return password;
	}

	@Override
	public final boolean equals(final Object object) {
		if (!(object instanceof User)) {
			return false;
		}

		User user = (User) object;
		return getName().equals(user.getName());
	}
}
